package algorithms.que12;

/**
 * @功能
 * @创建时间 2020/6/21
 */
public class CirRotation6 {
    public static void main(String[] args) {
        String a="1234";
       for(int i=0;i<4;i++){
           if (print(a,i).indexOf("3412")!=-1)
               System.out.println(print(a,i)+"########");
       }
    }
    public static String print(String from, int index) {
        from = reChange(from);
        System.out.println(from);
        String first = reChange(from.substring(0, from.length() - index));
        System.out.println(first);
        String second = reChange(from.substring(from.length() - index));
        System.out.println(second);
        from = first + second;
        System.out.println(from);
        return from;
    }
    public static String reChange(String from) {
        char[] froms = from.toCharArray();
        for (int i = 0; i < from.length() / 2; i++) {
            char temp = froms[i];
            froms[i] = froms[froms.length - 1 - i];
            froms[froms.length - 1 - i] = temp;
        }
        return String.valueOf(froms);
    }


}
